home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 026-050 / scopedisk38 / ue24c / config!m < prev    next >
Text File  |  1995-03-18  |  69KB  |  1,963 lines

  1. ======= MISCELLANEOUS CMDS =======
  2.  
  3. Set max number of files can load for normal editing (1-100, usually 20)
  4. <altCtl-f1:
  5.                 .. **** deactivate next 2 lines, if registered user.
  6.                 .. alertUser("Must have full Uedit to increase maximum files.")
  7.                 .. returnFalse
  8.                 putMsg("Input max # documents allowed (1-100)")
  9.                 if (inputNum(n54)) setMaxFiles(n54) >
  10.  
  11. Set start of hilite region
  12. <shft-buttonDown:    equateLoc(curFile,sHilite,mouseLoc) refreshDisplay >
  13. Set end of hilite region
  14. <alt-buttonDown:     equateLoc(curFile,eHilite,mouseLoc) refreshDisplay >
  15.  
  16. Mark region clicked with mouse
  17. <virtual-buttonDown:
  18.     equateLoc(curFile,atCursor,mouseLoc)
  19.     equateLoc(curFile,eInvert,atCursor)
  20.     equateLoc(curFile,sInvert,atCursor)
  21.     if (eqNum(curFile,38)) equateLoc(buf38,eHilite,sHilite)
  22.     while (mouseDown) inputKey(n54)
  23.  
  24.     if (is(curFile,eFile)) returnFalse
  25.     if (is(curFile,whiteSpace)) returnFalse
  26.  
  27.        while (not is(curFile,whiteSpace)) {             .. find start non-white
  28.         moveCursor(curFile,sChar)
  29.         if (is(curFile,sFile)) goto label(1)
  30.     }
  31. label(1)
  32.        if (is(curFile,whiteSpace)) moveCursor(curFile,eChar)
  33.        equateLoc(curFile,sInvert,atCursor)         .. sinvert = start non-white
  34.  
  35.        while (not is(curFile,whiteSpace)) {               .. find end non-white
  36.            moveCursor(curFile,eChar)
  37.         if (is(curFile,eFile)) goto label(2)
  38.     }
  39. label(2)
  40.     equateLoc(curFile,eInvert,atCursor)           .. einvert = end non-white
  41.        if (eqNum(curFile,38)) {                       .. in directory buffer 38
  42.         equateLoc(curFile,sHilite,sInvert)
  43.         equateLoc(curFile,eHilite,eInvert)
  44.         equateLoc(curFile,sInvert,eInvert)
  45.         moveCursor(curFile,sHilite)
  46.     }
  47.     refreshDisplay
  48. >
  49.  
  50. Load File or select Directory that is CTRL-clicked.
  51. <ctl-buttonDown:
  52.     equateNum(n7,curFile)
  53.     if (not runKey(virtual-buttonDown)) {
  54.         runKey(virtual-buttonUp)
  55.         return
  56.     }
  57.        if (not eqNum(curFile,38)) {
  58.         if (geLoc(curFile,sInvert,eInvert)) return .. no rgn
  59.         moveCursor(curFile,sChar)
  60.         if (not is(curFile,"/")) if (not is(curFile,":")) {
  61.             freeBuf(buf54)
  62.             moveCursor(curFile,sInvert)
  63.             while (not eqLoc(curFile,atCursor,eInvert)) {
  64.                 if (is(curFile,":")) goto label(99)
  65.                 moveCursor(curFile,eChar)
  66.             }
  67.             insertRgn(buf54,sFile,buf38,hilite)
  68. label(99)
  69.             insertRgn(buf54,eFile,curFile,invert)
  70.             loadFile(buf54)
  71.             return
  72.         }
  73.         moveCursor(curFile,eInvert)
  74.         freeBuf(buf53)
  75.         insertRgn(buf53,eFile,curFile,invert)
  76.         runKey(virtual-7) .. add dir to buf38
  77.     }
  78.     runKey(virtual-9) .. show dir msg
  79.     return
  80. >
  81.  
  82. Handle buf38 directory traffic
  83. <virtual-buttonUp:
  84.     runKey(virtual-8)                   .. load in dir defalts if not loaded
  85.     equateLoc(buf38,mouseLoc,atCursor)
  86.     equateNum(n8,0)
  87.     if (not eqNum(curFile,38)) if (not gotoSplit(buf38)) {
  88.         if (not splitWindow(buf38,7)) {
  89.             putMsg("Close a split window so can let you select Directory")
  90.             return
  91.         }
  92.         equateNum(n8,1) .. had to make split window
  93.     }
  94.     updateDisplay
  95.  
  96. label(98)
  97.     equateLoc(buf38,mouseLoc,sFile)
  98.     putMsg(
  99.     "Ctrl-mouse=SelectDir.  F1=Edit.  F2=DirList.  F3=Save.  F4=ChgDir.  F5=CD.")
  100.  
  101.     while (mouseDown) inputKey(n54)
  102.     getKeyVal(macroNum,inputChar)
  103.     if (eqNum(macroNum,normal-buttonDown)) { .. done bring down window
  104.         gotoSplit(buf[n7])
  105.         if (eqNum(n8,1)) splitWindow(buf38,0) .. close it if made it
  106.         runKey(virtual-9)
  107.         return
  108.     }
  109.     if (eqNum(macroNum,normal-f1)) { .. edit buf38
  110.             putMsg("Press left-Amiga-0 to elim split window.")
  111.             return
  112.     }
  113.     if (eqNum(macroNum,ctl-buttonDown)) {
  114.             runkey(virtual-buttonDown)
  115.             refreshDisplay
  116.             runKey(virtual-9)
  117.             delay(10)
  118.     }
  119.     if (eqNum(macroNum,normal-f2)) { .. get dir list
  120.             gotoSplit(buf[n7])
  121.             if (eqNum(n8,1)) splitWindow(buf38,0) .. close it if made it
  122.             if (newFile) {
  123.                 setFileName(curFile,"DirList")
  124.                 clearRgn(curFile,all)
  125.                 insertRgn(curFile,atCursor,buf38,hilite)
  126.                 insertChar(curFile,eLine)
  127.                 equateLoc(curFile,sPage,sFile)
  128.                 updateDisplay
  129.                 freeBuf(buf54)
  130.                 insertRgn(buf54,eFile,"dir ",all)
  131.                 insertRgn(buf54,eFile,buf38,hilite)
  132.                 execute(curFile,buf54)
  133.             
  134.                 .. massage dir list 
  135.                 getSearch(buf49)
  136.                 setSearch(" (dir)")
  137.                 moveCursor(curFile,sFile)
  138.                 while (search(curFile,locA,locB,1)) {
  139.                     clearRgn(curFile,loc)
  140.                     insertChar(curFile,"/")
  141.                     moveCursor(curFile,sLine)
  142.                     moveCursor(curFile,eWord)
  143.                     moveCursor(curFile,sWord)
  144.                     insertRgn(curFile,atCursor,buf38,hilite)
  145.                 }
  146.                 setSearch(buf49) .. restore search string
  147.                 moveCursor(curFile,sFile)
  148.                 flipFlag(curFile,changed)
  149.                 putMsg("Ctl-click dirnames to add, filenames to load.")
  150.                 return
  151.             } else putMsg("Can't open file buf for dir list")
  152.     }
  153.     if (eqNum(macroNum,normal-f3)) saveFile(buf38)
  154.     if (eqNum(macroNum,normal-f4)) { .. change dir
  155.             if (gtLoc(buf38,eHilite,sHilite)) {
  156.                 freeBuf(buf54)
  157.                 insertRgn(buf54,eFile,buf38,hilite)
  158.                 changeDir(buf54)
  159.                 goto label(0)
  160.             }
  161.     }
  162.     if (eqNum(macroNum,normal-f5)) { .. get CD
  163. label(0)
  164.             freeBuf(buf53)
  165.             execute(buf53,"CD")
  166.             freeBuf(buf54)
  167.             insertRgn(buf54,eFile,"CD = ",all)
  168.             insertRgn(buf54,eFile,buf53,line)
  169.             putMsg(buf54)
  170.             delay(25)
  171.     }
  172.     goto label(98)
  173. >
  174.  
  175. Click or drag mouse, put word/phrase into index in buf41.  (Ctl-w to see.)
  176. <shftAlt-buttonDown:
  177.    equateLoc(curFile,atCursor,mouseLoc)
  178.    moveCursor(curFile,eWord)
  179.    equateLoc(curFile,eInvert,atCursor)
  180.    moveCursor(curFile,sWord)
  181.    equateLoc(curFile,sInvert,atCursor)
  182.    refreshDisplay>
  183.  
  184. Click or drag mouse, put word/phrase into index in buf41.  (Ctl-w to see.)
  185. <shftAlt-buttonUp:
  186.    equateLoc(curFile,atCursor,mouseLoc)
  187.    moveCursor(curFile,eWord)
  188.    equateLoc(curFile,eInvert,atCursor)
  189.    if (geLoc(curFile,sInvert,eInvert)) returnFalse
  190.    moveCursor(curFile,sInvert)
  191.    if (is(curFile,upperCase)) equateNum(n0,1)
  192.    else equateNum(n0,0)
  193.    toLower(curFile)
  194.    copyChar(curFile,n54)
  195.    if (eqNum(n0,1)) toUpper(curFile)
  196.    if (isEmpty(buf41)) insertChar(buf41,eLine)
  197.    moveCursor(buf41,sFile)
  198.    equateLoc(buf41,sPage,atCursor)
  199.    label(1)
  200.    if (is(buf41,upperCase)) equateNum(n0,1)
  201.    else equateNum(n0,0)
  202.    toLower(buf41)
  203.    copyChar(buf41,n53)
  204.    if (eqNum(n0,1)) toUpper(buf41)
  205.    if (gtNum(n54,n53)) {
  206.        moveCursor(buf41,downLine)
  207.        if (not is(buf41,eFile)) goto label(1)
  208.    }
  209.    insertRgn(buf41,atCursor,curFile,invert)
  210.    insertChar(buf41,eLine)
  211. >
  212.  
  213. Set start of invert region
  214. <shftCtl-buttonDown: equateLoc(curFile,sInvert,mouseLoc) refreshDisplay >
  215. Set end of invert region
  216. <altCtl-buttonDown:  equateLoc(curFile,eInvert,mouseLoc) refreshDisplay >
  217. Drag mouse and create hilite region
  218. <shftAltCtl-buttonDown:
  219.    equateLoc(curFile,locA,mouseLoc)
  220.    while (trackMouse) nothing
  221.    if (gtLoc(curFile,locA,mouseLoc))
  222.        { equateLoc(curFile,sHilite,mouseLoc) equateLoc(curFile,eHilite,locA) }
  223.    else
  224.        { equateLoc(curFile,eHilite,mouseLoc) equateLoc(curFile,sHilite,locA) }
  225.    refreshDisplay >
  226.  
  227. Adjust active split window size with mouse
  228. <lAmiga-=:
  229.     getSplitLines(n53,n52)  .. see if is upper split
  230.     if (eqNum(n53,0)) {
  231.         putMsg("Adjust lower splits, not top one")
  232.         returnFalse .. don't size main window
  233.     }
  234.     putMsg("Press button, move mouse to set split window size")
  235.     getkey(N54)
  236.     if (not mouseDown) return
  237.     trackMouse
  238.     mouseXY(n4,n5)
  239.     equateNum(n54,curFile)
  240. label(0)
  241.     if (inputWaiting) { putMsg(" ") return }
  242.     trackMouse
  243.     mouseXY(n2,n3)
  244.     getSplitLines(n53,n52)  .. get start & stop
  245.     sub(n52,n52,n53)
  246.     if (gtNum(n5,n3)) {
  247.         if (gtNum(n53,3)) incNum(n52)
  248.         else goto label(0)
  249.     }
  250.     else if (gtNum(n3,n5)) decNum(n52)
  251.     else goto label(0)
  252.     if (not eqNum(n5,n3)) {
  253.         splitWindow(curFile,0)
  254.         if (gtNum(2,n52)) equateNum(n52,2)
  255.         splitWindow(buf[n54],n52)
  256.         updateDisplay
  257.         equateNum(n5,n3)
  258.     }
  259.     goto label(0)
  260.     >
  261.  
  262. Scroll up 1 line
  263. <normal-upArrow:     vScroll(upLine) >
  264. Scroll down 1 line
  265. <normal-downArrow:   vScroll(downLine) >
  266. Scroll right 1 char
  267. <normal-leftArrow:   hScroll(1) >
  268. Scroll left 1 char
  269. <normal-rightArrow:  hScroll(-1) >
  270. Scroll up 11 lines
  271. <shft-upArrow:       do (n54,1,11) vScroll(upLine) >
  272. Scroll down 11 lines
  273. <shft-downArrow:     do (n54,1,11) vScroll(downLine) >
  274. Scroll right 10 chars
  275. <shft-leftArrow:     hScroll(10) >
  276. Scroll left 10 chars
  277. <shft-rightArrow:    hScroll(-10) >
  278.  
  279. Scroll to start of page
  280. <alt-upArrow:        vScroll(sPage) >
  281. Scroll to bottom of page
  282. <alt-downArrow:      vScroll(ePage) >
  283. Scroll right 20 chars
  284. <alt-leftArrow:      hScroll(20) >
  285. Scroll left 20 chars
  286. <alt-rightArrow:     hScroll(-20) >
  287.  
  288. Scroll to start of file
  289. <ctl-upArrow:        vScroll(sFile) >
  290. Scroll to end of file
  291. <ctl-downArrow:      vScroll(eFile) >
  292. Scroll to end of line
  293. <ctl-leftArrow:      getLocal(curFile,n54,lineLength)
  294.                      hScroll(n54) >
  295. Scroll to start of line
  296. <ctl-rightArrow:     while (hScroll(-1)) nothing >
  297.  
  298. Load and show help file - press again to release help
  299. <normal-help:  if (not isEmpty(buf42)) {
  300.                    equateNum(n54,curFile)
  301.                    if (eqNum(n54,42)) freeBuf(buf42)
  302.                    else editBuf(buf42)
  303.                } else {
  304.                   insertFile(buf42,sFile,"Help!")
  305.                   if (isEmpty(buf42)) {
  306.                         freeBuf(buf42)
  307.                         insertFile(buf42,sFile,"S:Help!")
  308.                   }
  309.                   if (not isEmpty(buf42)) {
  310.                                editBuf(buf42)
  311.                                flipFlag(buf42,readOnly)
  312.                   } else putMsg("Can't find S:Help! file.")
  313.                } >
  314.  
  315.  
  316.  
  317. Show current values of line-length, lines/page, tab-table #, colors, etc
  318. <shft-help:     freeBuf(buf54)
  319.                 insertRgn(buf54,atCursor,
  320. "Serial number   :
  321. Buffer          :
  322. Changed         :
  323. Size            :
  324. Max files       :
  325. Split size      :
  326. Idle timer      :
  327. Colors          :
  328. End-of-line     :
  329. PM terminator   :
  330. Line length     :
  331. Lines/page      :
  332. Left margin     :
  333. Top margin      :
  334. Bottom margin   :
  335. Tab table       :
  336. Printer select  :
  337. Speak mode      :
  338. Speak speed     :
  339. Speak pitch     :
  340. Search wildcard :
  341. Search multiWild:
  342. Search allBut   :
  343. Search eitherOr :
  344. Search s-white  :
  345. Search m-white  :
  346.  
  347. ",all)
  348.         moveCursor(buf54,sFile)
  349.         moveCursor(buf54,eLine)
  350.         getSerialNum(n54)
  351.         toWord(buf54,n54)
  352.  
  353.         moveCursor(buf54,eline)
  354.         equateNum(n4,curFile)
  355.         toWord(buf54,n4)
  356.  
  357.         moveCursor(buf54,eline)
  358.         if (getFlag(curFile,changed)) insertChar(buf54,"Y")
  359.         else insertChar(buf54,"n")
  360.  
  361.         moveCursor(buf54,eline)
  362.         fileSize(curFile,n54)
  363.         toWord(buf54,n54)
  364.  
  365.         moveCursor(buf54,eline)
  366.         getMaxFiles(n54)
  367.         toWord(buf54,n54)
  368.  
  369.         moveCursor(buf54,eline)
  370.         toWord(buf54,splitSize)
  371.  
  372.         moveCursor(buf54,eline)
  373.         toWord(buf54,idleTime)
  374.  
  375.         moveCursor(buf54,eline)
  376.         getWBColors(n0,n1,n2,n3)
  377.         toWord(buf54,n0)
  378.         toWord(buf54,n1)
  379.         toWord(buf54,n2)
  380.         toWord(buf54,n3)
  381.  
  382.         moveCursor(buf54,eline)
  383.         copyChar(buf54,n54)
  384.         toWord(buf54,n54)
  385.  
  386.         moveCursor(buf54,eline)
  387.         toWord(buf54,pmESC)
  388.  
  389.         moveCursor(buf54,eLine)
  390.         getLocal(curFile,n54,lineLength)
  391.         toWord(buf54,n54)
  392.  
  393.         moveCursor(buf54,eline)
  394.         getLocal(curFile,n54,pageLines)
  395.         toWord(buf54,n54)
  396.  
  397.         moveCursor(buf54,eline)
  398.         getLocal(curFile,n54,leftMargin)
  399.         toWord(buf54,n54)
  400.  
  401.         moveCursor(buf54,eline)
  402.         getLocal(curFile,n54,topMargin)
  403.         toWord(buf54,n54)
  404.  
  405.         moveCursor(buf54,eline)
  406.         getLocal(curFile,n54,bottomMargin)
  407.         toWord(buf54,n54)
  408.  
  409.         moveCursor(buf54,eline)
  410.         getLocal(curFile,n54,tabTable)
  411.         toWord(buf54,n54)
  412.  
  413.         moveCursor(buf54,eline)
  414.         toWord(buf54,prefPrint)
  415.  
  416.         moveCursor(buf54,eline)
  417.         insertChar(buf54,speakMode)
  418.  
  419.         moveCursor(buf54,eline)
  420.         toWord(buf54,speakSpeed)
  421.  
  422.         moveCursor(buf54,eline)
  423.         toWord(buf54,speakPitch)
  424.  
  425.         moveCursor(buf54,eline)
  426.         insertChar(buf54,wildCard)
  427.  
  428.         moveCursor(buf54,eline)
  429.         insertChar(buf54,multiWild)
  430.  
  431.         moveCursor(buf54,eline)
  432.         insertChar(buf54,allBut)
  433.  
  434.         moveCursor(buf54,eline)
  435.         insertChar(buf54,eitherOr)
  436.  
  437.         moveCursor(buf54,eline)
  438.         add(n54,singleWhite,"0")
  439.         insertChar(buf54,n54)
  440.  
  441.         moveCursor(buf54,eline)
  442.         add(n54,multiWhite,"0")
  443.         insertChar(buf54,n54)
  444.  
  445.         equateLoc(buf54,sPage,sFile)
  446.         freeBuf(buf53)
  447.         insertRgn(buf53,sFile,"Settings for Buffer ",all)
  448.         toWord(buf53,n4)
  449.         insertChar(buf54,eLine)
  450.         setFileName(buf54,buf53)
  451.         equateNum(n53,curFile)
  452.         moveCursor(buf54,eFile)
  453.         editBuf(buf54)
  454.         putMsg(" ")
  455.         .. updateDisplay
  456.         getKey(n54)
  457.         editBuf(buf[n53])
  458.         freeBuf(buf54)>
  459.  
  460. Rotate 4 Workbench colors in Uedit
  461. <alt-help:     toggle(color) >
  462.  
  463. Start this Key-Help mode - press Amiga-ESC to leave this Key-Help mode
  464. <ctl-help: flipFlag(curFile,teachKeys) >
  465.  
  466. Refresh window (or screen in interlace), including title bar
  467. <shftCtl-help:     refreshDisplay >
  468.  
  469. Rebuild the menus by running the startup command
  470. <shftAltCtl-Help: runKey(startup) >
  471.  
  472. Close file.  If changed, ask "Save changes?"  If no files, ask "Really quit?"
  473. <normal-closeBox:
  474.                 if (getFlag(curfile,changed)) {
  475.                     if (askYesNo("Save changes?"))
  476.                         if (not saveFile(curFile)) return
  477.                 }
  478.                 freeBuf(curFile)
  479.                 if (isEmpty(curFile)) {
  480.                     equateNum(n1,0)
  481.                     getMaxFiles(n2)
  482.                     decNum(n2)
  483.                     do (n0,0,n2) if (not isEmpty(buf[n0])) equatenum(n1,1)
  484.                     if (eqNum(n1,0))
  485.                         if (askYesNo("Really quit?")) quit(0)
  486.                 } >
  487.  
  488. Switch to next document
  489. <normal-gadget1:  toggle(curFile) >
  490. Switch to previous document
  491. <normal-gadget2:  runKey(shft-f1) >
  492. Scroll display down
  493. <normal-gadget3:  while (mouseDown) { vScroll(downLine) updateDisplay } >
  494. Scroll display up
  495. <normal-gadget4:  while (mouseDown) { vScroll(upLine)   updateDisplay } >
  496.  
  497. Switch to next file
  498. <normal-f1:    toggle(curFile) >
  499.  
  500. Switch to previous file
  501. <shft-f1:      getMaxFiles(n53)
  502.                if (geNum(1,n53)) { editBuf(buf0) returnFalse }
  503.                decNum(n53)
  504.                equateNum(n54,curFile)
  505.                while (nothing) {
  506.                    if (gtNum(n54,n53)) equateNum(n54,n53)
  507.                    decNum(n54)
  508.                    if (gtNum(0,n54)) equateNum(n54,n53)
  509.                    if (getFileName(buf54,buf[n54])) {
  510.                        editBuf(buf[n54])
  511.                        returnTrue
  512.                    }
  513.                } >
  514. Load a file
  515. <alt-f1:       putMsg("Input new filename:")
  516.                freeBuf(buf43)
  517.                if (inputString(buf43)) loadFile(buf43) >
  518.  
  519. Open new "Noname" file
  520. <ctl-f1:       newFile >
  521. Insert file at cursor
  522. <shftAlt-f1:   putMsg("Input filename to insert:")
  523.                freeBuf(buf43)
  524.                if (inputString(buf43)) insertFile(curFile,atCursor,buf43) >
  525. Restore current file to original
  526. <shftCtl-f1:   if (not askYesNo("Restore file to original?"))
  527.                           returnFalse
  528.                if (getFileName(buf43,curFile))
  529.                    { freeBuf(curFile) loadFile(buf43) } >
  530.  
  531. Bring up file-requester
  532. <lAmiga-f1:
  533.     freeBuf(buf54)
  534.     execute(buf54,"FileReq")  .. file requester program: puts dir on line 1
  535.     moveCursor(buf54,sfile)   .. puts filename on line 2.  outputs "*" if no
  536.     copyChar(buf54,n53)       .. selection or one line error msg if error.
  537.     moveCursor(buf54,eLine)
  538.     moveCursor(buf54,eChar)
  539.     if (is(buf54,eFile)) {    .. was 1 line only
  540. label(0)
  541.         putMsg("No selection or no FileReq program or no Arp Library")
  542.         returnFalse
  543.     }
  544.     freeBuf(buf53)                                     .. directoryname line
  545.     insertRgn(buf53,sFile,buf54,line)              .. copy in directory name
  546.     runKey(virtual-7)        .. store dirname in buf38, if not already there
  547.     if (not eqNum(n53,"*")) {                       .. 1st line wasn't empty
  548.         clearRgn(buf54,line)                  .. erase dirname line in buf54
  549.         insertRgn(buf54,sFile,buf38,hilite)                .. insert dirname
  550.         loadFile(buf54)                                 .. now load the file
  551.     }
  552. >
  553.  
  554. Save file currently in window
  555. <normal-f2: saveFile(curFile) >
  556.  
  557. Save file under different name
  558. <shft-f2:   putMsg("Save file as:")
  559.             freeBuf(buf43)
  560.             if (inputString(buf43)) if (setFileName(curFile,buf43))
  561.                    saveFile(curFile) >
  562.  
  563. Save all changed files
  564. <alt-f2:    getMaxFiles(n53)
  565.             decNum(n53)
  566.             do(n54,0,n53)
  567.                if (getFlag(buf[n54],changed)) saveFile(buf[n54]) >
  568.  
  569. Turn on/off saving changes during idle periods
  570. <ctl-f2:  flipFlag(curFile,userLocalA)>
  571.  
  572. Abort the current file save
  573. <shftAlt-f2: abortSave >
  574.  
  575. Save hilite as...
  576. <shftCtl-f2:
  577.     freeBuf(buf43)
  578.     insertRgn(buf43,atCursor,buf38,hilite)
  579.     putMsg("Save hilite as:")
  580.     if (not inputString(buf43)) return
  581.     freeBuf(buf54)
  582.     insertRgn(buf54,efile,curFile,hilite)
  583.     setFileName(buf54,buf43)
  584.     saveFile(buf54)
  585.     freeBuf(buf54)
  586.     >
  587.  
  588. Close current file.  If changed, ask "Save changes?"
  589. <normal-f3: if (not isEmpty(curFile)) if (getFlag(curFile,changed))
  590.               if (askYesNo("Save changes before closing?"))
  591.                 if (not saveFile(curFile)) returnFalse
  592.             freeBuf(curFile) >
  593.  
  594. Save file, if changed, then close it
  595. <shft-f3:   if (getFlag(curFile,changed)) if (not saveFile(curFile))
  596.                                    returnFalse
  597.             freeBuf(curFile) >
  598.  
  599. Free all non-file buffers.  Erases search buffer, directory name, etc
  600. <alt-f3:    getMaxFiles(n52)
  601.             do(n54,n52,54) freeBuf(buf[n54]) >
  602.  
  603. Ask "Save changes?", if any changes, then ask "Really quit?"
  604. <normal-f4: if (not askYesNo("Really quit?")) returnFalse
  605.             equateNum(n53,0)
  606.             getMaxFiles(n52)
  607.             decNum(n52)
  608.             do(n54,0,n52) if (getFlag(buf[n54],changed)) equateNum(n53,1)
  609.             if (eqNum(n53,1)) if (askYesNo("Save changes?")) runKey(shft-f4)
  610.             quit(0) >
  611.  
  612. Save all changed files automatically, then quit
  613. <shft-f4:   getMaxFiles(n52)
  614.             decNum(n52)
  615.             do (n54,0,n52) if (getFlag(buf[n54],changed))
  616.                                if (not saveFile(buf[n54])) returnFalse
  617.             quit(0) >
  618.  
  619. Quit fast, WITHOUT saving any files!!
  620. <alt-f4:    quit(10) >
  621.  
  622. Swap next 2 commands. (Mouse buttons, menu selections, gadgets, keys.)
  623. <normal-f5:    putMsg("Next 2 function keys will be swapped!")
  624.                if (getKey(n53)) if (getKey(n54)) if (swapKey(n53,n54))
  625.                    { putMsg("Keys were swapped.") return }
  626.                putMsg(" ") >
  627.  
  628. Toggle overstrike typing mode
  629. <shft-f5:          flipFlag(curFile,overstrike) >
  630. Toggle autoindent typing mode
  631. <alt-f5:           flipFlag(curFile,autoIndent) >
  632. Toggle wordwrap typing mode
  633. <ctl-f5:           flipFlag(curFile,wordWrap) >
  634. Toggle "changed" status of current buffer
  635. <lAmiga-f5:   flipFlag(curFile,changed) >
  636. Convert file to read-only status
  637. <shftAlt-f5:       flipFlag(curFile,readOnly) >
  638. Toggle speak-messages status
  639. <shftCtl-f5:       flipFlag(curFile,speakMsgs) >
  640. Toggle speak-alerts status
  641. <altCtl-f5:        flipFlag(curFile,speakAlerts) >
  642. Toggle auto-backup mode
  643. <shftAltCtl-f5:    flipFlag(curFile,autoBackup) >
  644.  
  645. Select buffer 44 to use for scratch editing or writing commands
  646. <shft-f6:      editBuf(buf44)
  647.        putMsg("Type in command, <anykey: etc>, and press F6 to compile:") >
  648.  
  649. Save UE config to disk.  Default is Data! or last name you gave
  650. <alt-f6:
  651.        if (askYesNo("Save data?")) {
  652.            putMsg("Input data filename or pmESC:")
  653.            freeBuf(buf54)
  654.            inputString(buf54)
  655.            saveConfig(buf54)
  656.        } >
  657.  
  658. Restore UE config from disk.  Default is Data! or last name you gave
  659. <ctl-f6:
  660.        if (askYesNo("Load data?")) {
  661.            putMsg("Input data filename or pmESC:")
  662.            freeBuf(buf54)
  663.            inputString(buf54)
  664.            loadConfig(buf54)
  665.        } >
  666.  
  667. Compile configuration default values at the top of Config! file
  668. <altCtl-f6:     moveCursor(curFile,sFile)
  669.                 if (not compileDefaults) beepDisplay>
  670.  
  671. Input the number of a buffer to edit
  672. <shftAlt-f6:   putMsg("Input number of buffer to edit:")
  673.                if (inputNum(n54)) { editBuf(buf[n54]) vScroll(sFile) } >
  674.  
  675. Examine all buffers that aren't empty
  676. <shftCtl-f6:    getMaxFiles(n52)
  677.                 do (n54,n52,99) if (not isEmpty(buf[n54])) {
  678.                    editBuf(buf[n54])
  679.                    vScroll(sFile)
  680.                    updateDisplay
  681.                    putMsg("F1=continue, F2=edit this one, F3=stop:")
  682.                    getKey(n53)
  683.                    if (eqNum(n53,normal-f2)) { putMsg(" ") return }
  684.                    if (eqNum(n53,normal-f3)) goto label(1)
  685.                }
  686.                label(1)
  687.                toggle(curFile)
  688.                putMsg(" ") >
  689.  
  690. Kill next command, including mouse button, menu selection, gadget, key
  691. <shftAltCtl-f6:
  692.                putMsg("Next command-key will be deleted!")
  693.                if (getKey(n54)) if (killKey(n54))
  694.                    { putMsg("Key command was deleted.") return }
  695.                putMsg(" ") >
  696.  
  697.  
  698. Find out if keys have got commands attached
  699. <lAmiga-f6: putMsg("Press any key")
  700.             while (getKey(n54)) {
  701.                if (inUse(n54)) putMsg("In use - Amiga-esc=abort")
  702.                else putMsg("Available - Amiga-esc=abort")
  703.              }>
  704.  
  705. Push current buffer onto buffer stack
  706. <lAmiga-w:  push(curFile) runKey(virtual-w)  >
  707.  
  708. Pop buffer stack
  709. <rAmiga-w: getStackSize(n51,n52,n53)
  710.             if (geNum(0,n51)) {
  711.                 putMsg("Buffer stack is empty")
  712.                 returnFalse
  713.             }
  714.             if (not askYesNo("Replace current buffer, deleting old?")) 
  715.                 if (not newFile) {
  716.                     putMsg("Can't open a file buffer")
  717.                     returnFalse
  718.             }
  719.             pop(curFile)
  720.             runKey(virtual-w) >
  721.  
  722. Rotate buffer stack
  723. <shftAlt-w:  rollStack(curFile,1) runKey(virtual-w) >
  724.  
  725. Show number of buffers in stack
  726. <virtual-w: getStackSize(n51,n52,n53)
  727.             freeBuf(buf54)
  728.             insertRgn(buf54,atCursor,"Buffers on stack: ",all)
  729.             toWord(buf54,n51)
  730.             putMsg(buf54)  >
  731.  
  732. Input search text & search fwd.  (Either-Or="$", wildcards= "?" & "*".)
  733. <normal-f7:    freeBuf(buf49) runKey(shft-f7) >
  734.  
  735. Modify existing search text and then search fwd
  736. <shft-f7:      putMsg("Input search string:")
  737.                inputString(buf49)
  738.                setSearch(buf49)
  739.                runKey(normal-f9) >
  740.  
  741. Input new search wild-card characters
  742. <alt-f7:       putMsg("Input single wild-card char:")
  743.                getChar(wildCard)
  744.                putMsg("Input multi wild-card char:")
  745.                getChar(multiWild)
  746.                putMsg("White on single wildcards: 0=no, 1=space/tab, 2=all white:")
  747.                getChar(n54)
  748.                if (geNum(n54,"0")) if (geNum("2",n54))
  749.                     sub(singleWhite,n54,"0")
  750.                putMsg("White on multi wildcards: 0=no, 1=space/tab, 2=all white:")
  751.                getChar(n54)
  752.                if (geNum(n54,"0")) if (geNum("2",n54))
  753.                     sub(multiWhite,n54,"0")
  754.                putMsg("Input all-but delimiter char:")
  755.                getChar(allBut)
  756.                putMsg(" ")>
  757.  
  758. Input new search either-or character
  759. <ctl-f7:       putMsg("Input new search either-or char:")
  760.                getChar(eitherOr)
  761.                putMsg(" ")>
  762.  
  763. Input replace text to use in search-replace
  764. <normal-f8:    freeBuf(buf48) runKey(shft-f8) >
  765.  
  766. Modify existing replace text
  767. <shft-f8:      putMsg("input replace string:") inputString(buf48) >
  768.  
  769. Search forward, mark matched region, put cursor at start of rgn
  770. <normal-f9:  if (eqLoc(curFile,atCursor,eInvert)) moveCursor(curFile,sChar)
  771.              if (search(curFile,sInvert,eInvert,1)) {
  772.                putMsg(" ")
  773.                return
  774.              }
  775.              runKey(virtual-f9) > .. failed search msg
  776.  
  777. Search backward, mark matched region, put cursor at start of rgn
  778. <shft-f9:    if (search(curFile,sInvert,eInvert,-1)) {
  779.                putMsg(" ")
  780.                return
  781.              }
  782.              runKey(virtual-f9) > .. failed search msg
  783.  
  784. Failed search message used by fwd/bkwd search.
  785. <virtual-f9: putMsg("Search failed.")
  786.              equateLoc(curFile,sInvert,eInvert)
  787.              refreshDisplay
  788.              returnFalse >
  789.  
  790. Replace matched region with replace text, then search forward
  791. <normal-f10:   if (eqLoc(curFile,sInvert,eInvert)) returnFalse
  792.                clearRgn(curFile,invert)
  793.                insertRgn(curFile,sInvert,buf48,all)
  794.                runKey(normal-f9) >
  795.  
  796. Replace matched region with replace text, then search backward
  797. <shft-f10:     if (eqLoc(curFile,sInvert,eInvert)) returnFalse
  798.                clearRgn(curFile,invert)
  799.                insertRgn(curFile,sInvert,buf48,all)
  800.                runKey(shft-f9) >
  801.  
  802. Replace and continue forward search-replace until search fails
  803. <alt-f10:      while(runKey(normal-f10)) nothing >
  804.  
  805. Open a space under cursor for typing
  806. <shft-del: insertChar(curFile," ") moveCursor(curFile,sChar)
  807.         if (is(curFile,sLine)) refreshDisplay>
  808.  
  809. Open line for typing below cursor line
  810. <alt-del:  if (not is(curFile,eLine)) moveCursor(curFile,eLine)
  811.            insertChar(curFile,eLine)>
  812.  
  813. Delete line above cursor line
  814. <ctl-del:  equateLoc(curFile,mouseLoc,atCursor)
  815.            if (not is(curFile,sLine)) moveCursor(curFile,sLine)
  816.            if (not is(curFile,sFile)) {
  817.                moveCursor(curFile,upLine)
  818.                runKey(virtual-x)                            .. this runs ctl-d
  819.                moveCursor(curFile,mouseLoc)
  820.            }>
  821.  
  822. Open a space for typing in front of current word
  823. <shft-bs:  if (not is(curFile,sWord)) moveCursor(curFile,sWord)
  824.            runKey(shft-del)>
  825.  
  826. Open line for typing above the current line
  827. <alt-bs:   if (not is(curFile,sLine)) moveCursor(curFile,sLine)
  828.            insertChar(curFile,eLine)  moveCursor(curFile,sChar)>
  829.  
  830. Delete line below cursor line
  831. <ctl-bs:  equateLoc(curFile,mouseLoc,atCursor)
  832.            if (not is(curFile,eLine)) moveCursor(curFile,eLine)
  833.            if (not is(curFile,eFile)) {
  834.                moveCursor(curFile,downLine)
  835.                runKey(virtual-x)                     .. this runs ctl-d
  836.                moveCursor(curFile,mouseLoc)
  837.            }>
  838.  
  839.  
  840.                             *** Keypad Keys ***
  841. Find cursor and center it in window
  842. <normal-kp5:   vScroll(atCursor) >
  843.  
  844. Delete word left, storing it in Undo buffer
  845. <normal-kp7:   if (not eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  846.                equateLoc(curFile,locB,atCursor)
  847.                moveCursor(curFile,sWord)
  848.                equateLoc(curFile,locA,atCursor)
  849.                insertRgn(buf45,sFile,curFile,loc)
  850.                equateLoc(buf45,sPage,sFile)
  851.                clearRgn(curFile,loc) >
  852.  
  853. Delete word right, storing it in Undo buffer
  854. <normal-kp9:   if (not eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  855.                equateLoc(curFile,locA,atCursor)
  856.                moveCursor(curFile,eWord)
  857.                equateLoc(curFile,locB,atCursor)
  858.                insertRgn(buf45,eFile,curFile,loc)
  859.                equateLoc(buf45,sPage,sFile)
  860.                clearRgn(curFile,loc) >
  861. Move cursor up 1 line
  862. <normal-kp8:   moveCursor(curFile,upLine) >
  863. Move cursor down 1 line
  864. <normal-kp2:   moveCursor(curFile,downLine) >
  865. Move cursor to start of word
  866. <normal-kp4:   moveCursor(curFile,sWord) >
  867. Move cursor to end of word
  868. <normal-kp6:   moveCursor(curFile,eWord) >
  869.  
  870. Set start of hilite region at cursor
  871. <normal-kp1:   equateLoc(curFile,sHilite,atCursor) refreshDisplay >
  872.  
  873. Set end of hilite region at cursor
  874. <normal-kp3:   equateLoc(curFile,eHilite,atCursor) refreshDisplay >
  875.  
  876. UNDO scratch deletes, inserting scratch delete buffer at cursor
  877. <normal-kp0:   insertRgn(curFile,atCursor,buf45,all) >
  878.  
  879. Copy hilite region into buffer
  880. <normal-kpDot: if (getFlag(curFile,columnar)) { runKey(shftCtl-3) return }
  881.                if (gtLoc(curFile,eHilite,sHilite))
  882.                    { freeBuf(buf47) insertRgn(buf47,sFile,curFile,hilite)
  883.                      equateLoc(buf47,sPage,sFile) }
  884.                else returnFalse >
  885.  
  886. Copy hilite region into buffer, then delete hilite region
  887. <normal-kpMinus:    if (getFlag(curFile,columnar)) { runKey(shftCtl-1) return }
  888.                     if (runKey(normal-kpDot)) clearRgn(curFile,hilite) >
  889.  
  890. Insert copied hilite at cursor
  891. <normal-kpEnter:   if (getFlag(curFile,columnar)) { runKey(shftCtl-4) return }
  892.                    if (is(curFile,sFile)) {
  893.                         equateLoc(curFile,sHilite,atCursor)
  894.                         equateLoc(curFile,eHilite,sHilite)
  895.                    } else {
  896.                         equateLoc(curFile,sHilite,atCursor)
  897.                         decLoc(curFile,sHilite)
  898.                         equateLoc(curFile,eHilite,atCursor)
  899.                    }
  900.                    insertRgn(curFile,atCursor,buf47,all)
  901.                    if (eqLoc(curFile,atCursor,sHilite))
  902.                             equateLoc(curFile,sHilite,sFile)
  903.                    else incLoc(curFile,sHilite)
  904.                    if (not onScreen(atCursor)) vScroll(atCursor) >
  905.  
  906. Find cursor and center it in window
  907. <shft-kp5:     vScroll(atCursor) >
  908.  
  909. Delete char to left of cursor, storing it in Undo buffer
  910. <shft-kp7:     if (not eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  911.                equateLoc(curFile,locB,atCursor)
  912.                moveCursor(curFile,sChar)
  913.                equateLoc(curFile,locA,atCursor)
  914.                insertRgn(buf45,sFile,curFile,loc)
  915.                equateLoc(buf45,sPage,sFile)
  916.                clearRgn(curFile,loc) >
  917.  
  918. Delete char under cursor, storing it in Undo buffer
  919. <shft-kp9:     if (not eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  920.                equateLoc(curFile,locA,atCursor)
  921.                moveCursor(curFile,eChar)
  922.                equateLoc(curFile,locB,atCursor)
  923.                insertRgn(buf45,eFile,curFile,loc)
  924.                equateLoc(buf45,sPage,sFile)
  925.                clearRgn(curFile,loc) >
  926. Move cursor up one line
  927. <shft-kp8:     moveCursor(curFile,upLine) >
  928. Move cursor down one line
  929. <shft-kp2:     moveCursor(curFile,downLine) >
  930. Move cursor left 1 char
  931. <shft-kp4:     moveCursor(curFile,sChar) >
  932. Move cursor right 1 char
  933. <shft-kp6:     moveCursor(curFile,eChar) >
  934. Set start of hilite region at cursor
  935. <shft-kp1:     runKey(normal-kp1) >
  936. Set end of hilite region at cursor
  937. <shft-kp3:     runKey(normal-kp3) >
  938. UNDO scratch deletes, inserting scratch delete buffer at cursor
  939. <shft-kp0:     runKey(normal-kp0) >
  940. Copy hilite region into buffer
  941. <shft-kpDot:   runKey(normal-kpDot) >
  942. Copy hilite region into buffer, then delete hilite region
  943. <shft-kpMinus: runKey(normal-kpMinus) >
  944. Insert copied hilite region at cursor
  945. <shft-kpEnter: runKey(normal-kpEnter) >
  946.  
  947. Find cursor and center it in window
  948. <alt-kp5: vScroll(atCursor) >
  949. Delete to start of line, storing it in Undo buffer
  950. <alt-kp7:      if (not eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  951.                if (is(curFile,sLine)) runKey(shft-kp7)
  952.                else {
  953.                    equateLoc(curFile,locB,atCursor)
  954.                    moveCursor(curFile,sLine)
  955.                    equateLoc(curFile,locA,atCursor)
  956.                    insertRgn(buf45,sFile,curFile,loc)
  957.                    equateLoc(buf45,sPage,sFile)
  958.                    clearRgn(curFile,loc)
  959.                } >
  960. Delete to end of line, storing it in Undo buffer
  961. <alt-kp9:   if (not eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  962.             if (is(curFile,eLine)) runKey(shft-kp9)
  963.             else {
  964.                equateLoc(curFile,locA,atCursor)
  965.                moveCursor(curFile,eLine)
  966.                equateLoc(curFile,locB,atCursor)
  967.                insertRgn(buf45,eFile,curFile,loc)
  968.                equateLoc(buf45,sPage,sFile)
  969.                clearRgn(curFile,loc)
  970.             } >
  971. Move cursor to start of page
  972. <alt-kp8:   moveCursor(curFile,sPage) vScroll(atCursor)>
  973. Move cursor to end of page
  974. <alt-kp2:   moveCursor(curFile,ePage) >
  975. Move cursor to start of line
  976. <alt-kp4:   moveCursor(curFile,sLine) >
  977. Move cursor to end of line
  978. <alt-kp6:   moveCursor(curFile,eLine) >
  979. Set start of hilite region at cursor
  980. <alt-kp1:   runKey(normal-kp1) >
  981. Set end of hilite region at cursor
  982. <alt-kp3:   runKey(normal-kp3) >
  983.  
  984. UNDO scratch deletes, inserting scratch delete buffer at cursor
  985. <alt-kp0:     runKey(normal-kp0) >
  986. Copy hilite region into buffer
  987. <alt-kpDot:   runKey(normal-kpDot) >
  988. Copy hilite region into buffer, then delete hilite region
  989. <alt-kpMinus: runKey(normal-kpMinus) >
  990. Insert copied hilite region at cursor
  991. <alt-kpEnter: runKey(normal-kpEnter) >
  992.  
  993. Find cursor and center it in window
  994. <ctl-kp5:      vScroll(atCursor) >
  995. Delete from cursor to start of page, storing it in Undo buffer
  996. <ctl-kp7:      if (not eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  997.                equateLoc(curFile,locB,atCursor)
  998.                moveCursor(curFile,sPage)
  999.                equateLoc(curFile,locA,atCursor)
  1000.                insertRgn(buf45,sFile,curFile,loc)
  1001.                equateLoc(buf45,sPage,sFile)
  1002.                clearRgn(curFile,loc)
  1003.                vScroll(atCursor)
  1004.                updateDisplay >
  1005. Delete from cursor to end of page, storing it in Undo buffer
  1006. <ctl-kp9:      if (not eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  1007.                equateLoc(curFile,locA,atCursor)
  1008.                moveCursor(curFile,ePage)
  1009.                equateLoc(curFile,locB,atCursor)
  1010.                insertRgn(buf45,eFile,curFile,loc)
  1011.                equateLoc(buf45,sPage,sFile)
  1012.                clearRgn(curFile,loc)
  1013.                updateDisplay >
  1014.  
  1015. Move cursor to start of form
  1016. <ctl-kp8:      moveCursor(curFile,sForm) >
  1017. Move cursor to end of form
  1018. <ctl-kp2:      moveCursor(curFile,eForm) >
  1019. Move cursor to start of line
  1020. <ctl-kp4:      moveCursor(curFile,sLine) >
  1021. Move cursor to end of line
  1022. <ctl-kp6:      moveCursor(curFile,eLine) >
  1023. Set start of invert region at cursor
  1024. <ctl-kp1:      equateLoc(curFile,sInvert,atCursor) refreshDisplay >
  1025. Set end of invert region at cursor
  1026. <ctl-kp3:      equateLoc(curFile,eInvert,atCursor) refreshDisplay >
  1027.  
  1028. UNDO scratch deletes, inserting scratch delete buffer at cursor
  1029. <ctl-kp0:      runKey(normal-kp0) >
  1030.  
  1031. Give message telling turn OFF columnar if columnar is ON.
  1032. <virtual-kpDot:
  1033.     if (getFlag(curFile,columnar)) {
  1034.         alertuser("Turn OFF columnar display mode first. (See Columnar menu.)")
  1035.         abort } >
  1036.  
  1037. Copy invert region into buffer
  1038. <ctl-kpDot:    runKey(virtual-kpDot)
  1039.                if (gtLoc(curFile,eInvert,sInvert))
  1040.                    { freeBuf(buf46) insertRgn(buf46,sFile,curFile,invert)
  1041.                      equateLoc(buf46,sPage,sFile) }
  1042.                else returnFalse >
  1043.  
  1044. Copy invert region into buffer, then delete invert region
  1045. <ctl-kpMinus:  runKey(virtual-kpDot)
  1046.                runKey(ctl-kpDot) clearRgn(curFile,invert) >
  1047.  
  1048. Insert copied invert region at cursor
  1049. <ctl-kpEnter:      runKey(virtual-kpDot)
  1050.                    if (is(curFile,sFile)) {
  1051.                         equateLoc(curFile,sInvert,atCursor)
  1052.                         equateLoc(curFile,eInvert,sInvert)
  1053.                    } else {
  1054.                         equateLoc(curFile,sInvert,atCursor)
  1055.                         decLoc(curFile,sInvert)
  1056.                         equateLoc(curFile,eInvert,atCursor)
  1057.                    }
  1058.                    insertRgn(curFile,atCursor,buf46,all)
  1059.                    if (eqLoc(curFile,atCursor,sInvert))
  1060.                             equateLoc(curFile,sInvert,sFile)
  1061.                    else incLoc(curFile,sInvert)
  1062.                    if (not onScreen(atCursor)) vScroll(atCursor) >
  1063.  
  1064.                         *** miscellaneous keys ***
  1065.  
  1066. Set new line-length
  1067. <ctl-return: putMsg("Enter new line-length:")
  1068.              if (inputNum(n54))
  1069.              { setLocal(curFile,lineLength,n54) equateNum(lineLength,n54) } >
  1070.  
  1071. Transparent tab forward
  1072. <shft-tab: moveCursor(curFile,eTab) >
  1073.  
  1074. Transparent tab backward
  1075. <alt-tab:  moveCursor(curFile,sTab) >
  1076.  
  1077. Untab - delete white space back to previous tab column
  1078. <ctl-tab: equateLoc(curFile,locA,atCursor)
  1079.             moveCursor(curFile,sTab)
  1080.             while (nothing) {
  1081.                 if (is(curFile,space)) goto label(1)
  1082.                 if (is(curFile,9))  goto label(1)  .. a TAB
  1083.                 return
  1084.                 label(1)
  1085.                 clearChar(curFile)
  1086.                 if (eqLoc(curFile,atCursor,locA)) return
  1087.             }>
  1088. Switch to/from using spaces for tabs or using real tabs
  1089. <altCtl-tab: flipFlag(curFile,trueTabs)>
  1090.  
  1091. Show tab ruler above cursor line
  1092. <shftAlt-tab:  seeRuler>
  1093.  
  1094. Set tab ruler using mouse or keys
  1095. <shftCtl-tab:
  1096.     putMsg(
  1097.     "Use mouse click/drag, Tab, Space, BS, Del (anykey=quit,Amiga-ESC=abort)")
  1098.     setRuler putMsg(" ") >
  1099.  
  1100. Convert tabs in document to spaces
  1101. <lAmiga-t: tabsToSpaces >
  1102.  
  1103. Convert spaces in document to TABs
  1104. <rAmiga-t: spacesToTabs >
  1105.  
  1106. Set TAB table number (0-4) to use for TAB spacing
  1107. <shftAltCtl-tab:
  1108.            putMsg("Enter new tab table # (0-4):")
  1109.            if (inputNum(n54)) if (geNum(n54,0)) if (geNum(4,n54))
  1110.              { setLocal(curFile,tabTable,n54) equateNum(tabTable,n54) } >
  1111.  
  1112. Toggle "busies" setting - when turned on, it shows buffers being worked on
  1113. <ctl-b:  flipFlag(curFile,busies) >
  1114.  
  1115. Trim spaces between the next two words after cursor
  1116. <alt-c:  while (not is(curFile,space))
  1117.            { moveCursor(curFile,eChar) if (is(curFile,eFile)) returnTrue }
  1118.          moveCursor(curFile,eChar)
  1119.          while (is(curFile,space)) clearChar(curFile) >
  1120.  
  1121. Let next character typed be a CTRL-character, such as formfeed, etc
  1122. <ctl-c: putMsg("Input a control character:")
  1123.         getChar(n54)
  1124.         if (geNum(31,n54)) goto label(1)
  1125.         if (geNum(n54,64)) if (geNum(127,n54)) {
  1126. label(1)
  1127.             and(n54,n54,31)
  1128.             insertChar(curFile,n54) 
  1129.         }
  1130.         putMsg(" ") >
  1131.  
  1132.  
  1133. Count number of times the next command is successfully executed
  1134. <shftAlt-c:    equateNum(n44,0)
  1135.                putMsg("Input command to execute & count:")
  1136.                if (getKey(n53)) {
  1137.                    while (runKey(n53)) incNum(n44)
  1138.                    freeBuf(buf54)
  1139.                    insertRgn(buf54,sFile,"Times executed = ",all)
  1140.                    toWord(buf54,n44)
  1141.                    putMsg(buf54)
  1142.                } >
  1143.  
  1144. Delay the amount of time (tenths of seconds) stored using shftAlt-d
  1145. <alt-d:    delay(n46) >
  1146. Delete cursor line, storing it in Undo buffer.  (See keypad-0/7/9.)
  1147. <ctl-d:   runKey(virtual-x)
  1148. >
  1149.  
  1150. Delete cursor line
  1151. <virtual-x:
  1152.         if (not eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  1153.            equateLoc(curFile,locB,atCursor)
  1154.            if (not is(curFile,sLine)) moveCursor(curFile,sLine)
  1155.            if (not eqLoc(curFile,locB,atCursor)) {
  1156.                equateLoc(curFile,locA,atCursor)
  1157.                insertRgn(buf45,sFile,curFile,loc)
  1158.                clearRgn(curFile,loc)
  1159.            } else equateLoc(curFile,locA,atCursor)
  1160.            if (not is(curFile,eLine)) moveCursor(curFile,eLine)
  1161.            moveCursor(curFile,eChar)
  1162.            equateLoc(curFile,locB,atCursor)
  1163.            insertRgn(buf45,eFile,curFile,loc)
  1164.            equateLoc(buf45,sPage,sFile)
  1165.            clearRgn(curFile,loc) >
  1166.  
  1167. Set the delay variable to some value in tenths of seconds
  1168. <shftAlt-d: putMsg("Input # tenths of seconds (used in delays)")
  1169.             inputNum(n46) >
  1170.  
  1171. Change end-of-line character
  1172. <alt-e:    putMsg("Input new end-of-line value (usually 10 or 13):")
  1173.            inputNum(n54)
  1174.            setEol(n54)
  1175.            refreshDisplay >
  1176.  
  1177. Change current document's end-of-line character
  1178. <ctl-e:
  1179.        putMsg("Input file's current end-of-line value (usually 10 or 13):")
  1180.            inputNum(n54)
  1181.            if (not gtNum(n54,0)) returnFalse
  1182.            putMsg("Input new end-of-line value (usually 10 or 13):")
  1183.            inputNum(n53)
  1184.            if (not gtNum(n53,0)) returnFalse
  1185.            setEol(n54)
  1186.            moveCursor(curFile,sFile)
  1187.            putMsg("Changing eol characters ... Amiga-ESC=abort.")
  1188.            while (moveCursor(curFile,eLine))
  1189.                if (is(curFile,n54)) swapChar(curFile,n53)
  1190.            setEol(n53)
  1191.            vScroll(sFile)
  1192.            putMsg(" ")
  1193.            refreshDisplay >
  1194. Input the number of buffer to free
  1195. <alt-f:    putMsg("Input buffer # to free:")
  1196.            if (inputNum(n54)) freeBuf(buf[n54]) >
  1197.  
  1198. Flip upper/lower case of char under cursor
  1199. <ctl-f:    if (is(curFile,alpha)) {
  1200.                if (is(curFile,lowerCase)) toUpper(curFile)
  1201.                else toLower(curFile)
  1202.            }
  1203.            moveCursor(curFile,eChar) >
  1204.  
  1205. Toggle the mark-gadgets setting.  When "off", the gadget names don't show
  1206. <ctl-g:    flipFlag(curFile,markGadgets) >
  1207.  
  1208. Input a new lines/page value
  1209. <alt-g:    putMsg("Enter new lines/page setting:")
  1210.            inputNum(n54)
  1211.            if (gtNum(n54,0))
  1212.            { setLocal(curFile,pageLines,n54) equateNum(pageLines,n54) } >
  1213.  
  1214. Uncolor the hilite region
  1215. <alt-h:    equateLoc(curFile,sHilite,eHilite) refreshDisplay >
  1216.  
  1217. Erase hilite region.  No Copy is made!
  1218. <ctl-h:    clearRgn(curFile,hilite) >
  1219.  
  1220. Uncolor the invert region
  1221. <alt-i:    equateLoc(curFile,sInvert,eInvert) refreshDisplay >
  1222.  
  1223. Erase the invert region.  No Copy is made!
  1224. <ctl-i:    clearRgn(curFile,invert) >
  1225.  
  1226. Scan index buffer, build an index.  (See shftAlt-buttonDown/buttonUp.)
  1227. <shftAlt-i:
  1228.    if (isEmpty(buf41)) returnFalse
  1229.    runKey(alt-g)            .. Could elim.  get lines-per-page setting to use
  1230.    freeBuf(buf54)
  1231.  
  1232.    .. erase duplicate items in buf41
  1233.    putMsg("Working....")
  1234.  
  1235. label(10)   .. get next index item
  1236.    moveCursor(buf41,sFile)
  1237.    while (is(buf41,whiteSpace)) clearChar(buf41)    .. clear any blank lines
  1238.    if (is(buf41,eFile)) goto label(11)              .. done finding duplicates
  1239.    equateLoc(buf41,sInvert,atCursor)                .. mark start
  1240.    moveCursor(buf41,downLine)
  1241.    equateLoc(buf41,eInvert,atCursor)                .. mark end
  1242.    freeBuf(buf49)
  1243.    insertRgn(buf49,eFile,buf41,invert)              .. copy item to buf49
  1244.    clearRgn(buf41,invert)                           .. erase from buf41
  1245.    insertRgn(buf54,eFile,buf49,all)                 .. add it to buf54
  1246.    moveCursor(buf41,eFile)                          .. search bkwd for dups
  1247.    setSearch(buf49)
  1248.    while (search(buf41,sInvert,eInvert,-1)) {
  1249.         clearRgn(buf41,invert)                      .. erase the dup
  1250.         .. moveCursor(buf41,eFile)                  .. shouldn't need this
  1251.    }
  1252.    goto label(10)           .. get next item, unless buf41 empty now.
  1253.  
  1254. label(11)
  1255.    freeBuf(buf41)                   .. starting over
  1256.    insertRgn(buf41,eFile,buf54,all) .. store no-dup list in buf41
  1257.    freeBuf(buf54)                   .. erase old list in buf54
  1258.                                     .. NOTE: should have used swapBuf instead
  1259.    label(1)
  1260.    moveCursor(buf41,sFile)
  1261.    while (is(buf41,whiteSpace)) clearChar(buf41)    .. clear lead white space
  1262.    if (is(buf41,eFile)) {               .. buf41 empty, must be finished
  1263.        swapBuf(buf54,buf41)             .. index was in buf54
  1264.        freeBuf(buf54)
  1265.        setFileName(buf41,"Index")
  1266.        equateLoc(buf41,sPage,sFile)
  1267.        equateLoc(buf41,atCursor,sFile)
  1268.        putMsg("Press ctl-w to see Index")   .. finished
  1269.        return
  1270.    }
  1271.    freeBuf(buf49)
  1272.    insertRgn(buf49,sFile,buf41,line)    .. load search string with item.
  1273.    clearRgn(buf41,line)                 .. erase the item
  1274.    putMsg(buf49)                        .. show the item
  1275.    moveCursor(buf54,eFile)              .. put item at end of index building
  1276.    insertRgn(buf54,eFile,buf49,all)
  1277.    insertRgn(buf54,eFile,"  ",all)      .. space before page #s that go in
  1278.    insertChar(buf54,eLine)
  1279.    moveCursor(buf54,sChar)
  1280.    equateNum(n53,0)                     .. so know if need comma
  1281.    moveCursor(curFile,sFile)
  1282.    label(2)
  1283.    setSearch(buf49)
  1284.    while (search(curFile,sInvert,eInvert,1)) {
  1285.        moveCursor(curFile,sChar)
  1286.        if (is(curFile,alpha)) {
  1287.            label(3)                     .. part of a bigger word so ignore
  1288.            moveCursor(curFile,eInvert)
  1289.            goto label(2)                .. and resume search
  1290.        }
  1291.        if (is(curFile,digit)) goto label(3) .. part of bigger word, ignore
  1292.        moveCursor(curFile,eInvert)
  1293.        if (is(curFile,alpha)) goto label(2) .. part of bigger word, ignore
  1294.        if (is(curFile,digit)) goto label(2) .. ditto
  1295.        getPageRowCol(n54,n50,n49)  .. this uses display
  1296.        moveCursor(curFile,eForm)   .. don't search again on this page
  1297.        if (not eqNum(n53,0)) insertChar(buf54,",")  .. put comma if not 1st #
  1298.        toWord(buf54,n54)            .. install the page # after index item
  1299.        equateNum(n53,n54)           .. so will put in comma next time for sure
  1300.    }
  1301.    goto label(1)                    .. get next item from buf41
  1302. >
  1303. Toggle the "make icons" flag.  When "on", Workbench icons are created
  1304. <altCtl-i:   flipFlag(curFile,icons)>
  1305.  
  1306. Enter idle-timer value (tenths of sec) after which idle command executed
  1307. <shftAltCtl-i:  putMsg("Input idle time (tenths of a second)")
  1308.                 if (inputNum(n54)) equateNum(idleTime,n54)>
  1309.  
  1310. Toggle the right-justify typing mode
  1311. <alt-j:    flipFlag(curFile,rightJustify) >
  1312. Join next line to cursor line
  1313. <ctl-j:    if (not is(curFile,eLine)) moveCursor(curFile,eLine)
  1314.            equateLoc(curFile,locA,atCursor)
  1315.            label(1)
  1316.            moveCursor(curFile,eChar)
  1317.            if (is(curFile,space)) goto label(1)
  1318.            if (is(curFile,9)) goto label(1)  .. a TAB
  1319.            equateLoc(curFile,locB,atCursor)
  1320.            clearRgn(curFile,loc)
  1321.            insertChar(curFile," ") >
  1322.  
  1323. Move the hilite to the left by one character (space or tab)
  1324. <alt-l:    moveCursor(curFile,sHilite)
  1325.            if (not is(curFile,sLine)) moveCursor(curFile,sLine)
  1326.            label(1)
  1327.            if (is(curFile,space))  clearChar(curFile)
  1328.            else if (is(curFile,9)) clearChar(curFile) .. a TAB
  1329.            if (not is(curFile,eLine)) moveCursor(curFile,eLine)
  1330.            moveCursor(curFile,eChar)  .. start of next line
  1331.            if (gtLoc(curFile,eHilite,atCursor)) goto label(1) >
  1332.  
  1333. Convert the character under the cursor to lower case and move cursor fwd
  1334. <ctl-l:    toLower(curFile) moveCursor(curFile,eChar) >
  1335.  
  1336. Set bottom margin
  1337. <lAmiga-l:  putMsg("Input bottom margin lines (0-200):")
  1338.             if (inputNum(n54)) equateNum(bottomMargin,n54)
  1339.             setLocal(curFile,bottomMargin,bottomMargin)>
  1340.  
  1341. Set command multiplier to use for next command
  1342. <ctl-m:    putMsg("Input command multiplier:") inputNum(cmdMultiplier) >
  1343.  
  1344. Swap the mouse's button-Up operation with the next key-command pressed
  1345. <alt-m:        putMsg("Will swap mouse buttonUp with your next input:")
  1346.                if (getKey(n53)) if (swapKey(n53,normal-buttonUp))
  1347.                    { putMsg("Swapped - to undo, do it again") return }
  1348.                putMsg(" ") >
  1349.  
  1350. Map illegal ASCII (0 thru 5) characters into safe ones.  (See top of Config!)
  1351. <shftAlt-m:  flipFlag(curFile,mapChars)>
  1352.  
  1353. Rename the document in the window
  1354. <alt-n:    putMsg("Input new filename:")
  1355.            getFileName(buf43,curFile)
  1356.            if (inputString(buf43))
  1357.            setFileName(curFile,buf43) >
  1358.  
  1359. Input a text line number to go to
  1360. <ctl-n:    putMsg("Input line number:")
  1361.            if (inputNum(n54))
  1362.                { lineToLoc(curFile,atCursor,n54) vScroll(atCursor) } >
  1363.  
  1364. Open the cursor line for typing
  1365. <ctl-o:    insertChar(curFile,eLine) moveCursor(curFile,sChar) >
  1366.  
  1367. Move the hilite region to the right by one space
  1368. <alt-r:    moveCursor(curFile,sHilite)
  1369.            if (not is(curFile,sLine)) moveCursor(curFile,sLine)
  1370.            label(1)
  1371.            if (gtLoc(curFile,eHilite,atCursor)) {
  1372.                insertChar(curFile,32)
  1373.                if (not is(curFile,eLine)) moveCursor(curFile,eLine)
  1374.                moveCursor(curFile,eChar)
  1375.                goto label(1)
  1376.            } >
  1377. Terminate Learn Mode or run whatever is stored in learn-buffer.  (See ctl-s.)
  1378. <ctl-r:    runLearn >
  1379.  
  1380. Speak the hilite region, a line at a time
  1381. <alt-s:    if (gtLoc(curFile,eHilite,sHilite)) {
  1382.                equateLoc(curFile,locA,atCursor)
  1383.                equateLoc(curFile,sInvert,sHilite)
  1384.                equateLoc(curFile,atCursor,sHilite)
  1385.                while (gtLoc(curFile,eHilite,sInvert)) {
  1386.                    if (not is(curFile,eLine)) moveCursor(curFile,eLine)
  1387.                    moveCursor(curFile,eChar)
  1388.                    if (gtLoc(curFile,atCursor,eHilite))
  1389.                         equateLoc(curFile,eInvert,eHilite)
  1390.                    else equateLoc(curFile,eInvert,atCursor)
  1391.                    if (gtLoc(curFile,eInvert,sInvert)) {
  1392.                        freeBuf(buf50)
  1393.                        insertRgn(buf50,sFile,curFile,invert)
  1394.                        speak(buf50)
  1395.                    }
  1396.                    equateLoc(curFile,sInvert,atCursor)
  1397.                }
  1398.                equateLoc(curFile,atCursor,locA)
  1399.            } >
  1400.  
  1401. Start/abort Learn Mode.  (Use ctl-r to finish & to run it.)
  1402. <ctl-s:    if (not getFlag(curFile,learnMode)) putMsg("LEARN MODE ACTIVE!")
  1403.            else putMsg("Learn Mode cancelled.")
  1404.            flipFlag(curFile,learnMode) >
  1405.  
  1406. Show key-help message on next key pressed.  Copy key-help to RAM: on first
  1407. <ctl-t:    putMsg("Input a key, gadget, click etc to get Help msg")
  1408.                 getKey(n54)
  1409.                 teachOne(n54)>
  1410.  
  1411. Toggle between using printable keys for commands or for normal typing input
  1412. <alt-u: flipFlag(curFile,useKeys)>
  1413.  
  1414. Load UStar config
  1415. <virtual-u:  if (not loadConfig("UstarData!")) loadConfig("S:UstarData!") >
  1416.  
  1417. Convert char under cursor to upper case
  1418. <ctl-u:    toUpper(curFile) moveCursor(curFile,eChar) >
  1419.  
  1420. Set left margin
  1421. <lAmiga-m:  putMsg("Input left margin column (0-200):")
  1422.             if (inputNum(n54)) equateNum(leftMargin,n54)
  1423.             setLocal(curFile,leftMargin,leftMargin)>
  1424.  
  1425. Set top margin
  1426. <lAmiga-u:  putMsg("Input top margin lines (0-200):")
  1427.             if (inputNum(n54)) equateNum(topMargin,n54)
  1428.             setLocal(curFile,topMargin,topMargin)>
  1429.  
  1430. Switch flag that makes CTRL chars vis/invis
  1431. <ctl-v:    flipFlag(curFile,spooks) refreshDisplay >
  1432.  
  1433. Swap the current document in window with buffer 41
  1434. <ctl-w:    swapBuf(curFile,buf41) >
  1435.  
  1436. Swap current buffer to buffer 0 (the "home" buffer of Uedit)
  1437. <alt-w: swapBuf(buf0,curFile) editBuf(buf0) >
  1438.  
  1439. For programmers:  Toggle number under cursor between hex/decimal
  1440. <ctl-x:    hexDecimal(curFile) >
  1441.  
  1442. Execute an AmigaDOS command, but don't collect the results
  1443. <ctl-y:    putMsg("Enter AmigaDOS command")
  1444.            freeBuf(buf40)
  1445.            if (inputString(buf40)) execute(" ",buf40) >
  1446.  
  1447. Execute an AmigaDOS command and show the results
  1448. <ctl-z:    putMsg("Enter AmigaDOS command")
  1449.            freeBuf(buf40)
  1450.            if (not inputString(buf40)) returnFalse
  1451.            freeBuf(buf39)
  1452.            if (not execute(buf39,buf40)) returnFalse
  1453.            if (not isEmpty(buf39))
  1454.                { putMsg("Result of AmigaDOS command:")
  1455.                flipFlag(buf39,changed)
  1456.                editBuf(buf39)
  1457.                vscroll(sFile)
  1458.                updateDisplay
  1459.                } else
  1460.                { putMsg("No reply from AmigaDOS.") freeBuf(buf39) } >
  1461.  
  1462. Searcu for buf53 dirname in buf38.  Add name to list if not there.
  1463. <virtual-7:
  1464.     moveCursor(buf53,eFile)
  1465.     decLoc(buf53,atCursor)
  1466.     if (not is(buf53,"/")) if ( not is(buf53,":")) 
  1467.         insertRgn(buf53,eFile,"/",all)
  1468.     if (isEmpty(buf38)) runKey(virtual-8)       .. default dir names
  1469.     .. if (isEmpty(buf38)) goto label(0)
  1470.     moveCursor(buf38,sFile)
  1471.     equateLoc(buf38,eHilite,sHilite)
  1472. label(1)
  1473.     while (is(buf38,whiteSpace)) moveCursor(buf38,eChar)
  1474.     if (is(buf38,eFile)) goto label(0)                             .. add it
  1475.     equateLoc(buf38,sHilite,atCursor)                         .. store start
  1476.     while (not is(buf38,whiteSpace)) {
  1477.         if (is(buf38,eFile)) goto label(2)
  1478.         moveCursor(buf38,eChar)
  1479.     }
  1480. label(2)
  1481.     equateLoc(buf38,eHilite,atCursor)                           .. store end
  1482.     freeBuf(buf52)
  1483.     insertRgn(buf52,sFile,buf38,hilite)
  1484.     if (not stringComp(n54,buf53,buf52,1)) goto label(1)        .. try again
  1485.     moveCursor(buf38,sHilite)         .. found dirname.  Put cursor at start
  1486.     goto label(5)
  1487. label(0)                                       .. dirname not found.  Add it
  1488.     moveCursor(buf38,eFile)
  1489.     if (not isEmpty(buf53)) {
  1490.         locToCol(buf38,n54,atCursor)
  1491.         if (gtNum(n54,60)) insertChar(buf38,eLine)
  1492.         else insertChar(buf38,9) .. tab insertRgn(buf38,atCursor,"   ",all)
  1493.     }
  1494.     equateLoc(buf38,sHilite,eFile)
  1495.     decLoc(buf38,sHilite)
  1496.     insertRgn(buf38,eFile,buf53,all)        .. install new dirname as curdir
  1497.     equateLoc(buf38,eHilite,eFile)
  1498.     incLoc(buf38,sHilite)
  1499.     moveCursor(buf38,sHilite)
  1500.     equateNum(n54,curFile)
  1501. label(5)
  1502.     freeBuf(buf53)
  1503.     if (not eqNum(n54,38))
  1504.         if (gotoSplit(buf38)) gotoSplit(buf[n54]) .. force refresh
  1505.     runKey(virtual-9)
  1506. >
  1507.  
  1508. Load beginning directory names into buf38
  1509. <virtual-8:
  1510.     if (isEmpty(buf38)) {
  1511.         if (not insertFile(buf38,eFile,"S:Directories"))
  1512.                insertRgn(buf38,eFile," DF0:    DF1:    DH0:    S:    RAM:    VD0:",all) 
  1513.          moveCursor(buf38,eFile)
  1514.          equateLoc(buf38,sHilite,eHilite)
  1515.         equateLoc(buf38,mouseLoc,eFile)
  1516.      }
  1517.      equateLoc(buf38,sPage,sFile) >
  1518.  
  1519. Put up msg telling what click-loading directory now is.
  1520. <virtual-9:
  1521.     freeBuf(buf53)
  1522.     insertRgn(buf53,eFile,"Click-loading directory = ",all)
  1523.     if (gtLoc(buf38,eHilite,sHilite)) insertRgn(buf53,eFile,buf38,hilite)
  1524.     else insertRgn(buf53,eFile,"default",all)
  1525.     putMsg(buf53)
  1526.     freebuf(buf53) >
  1527.  
  1528. Get listing. (Also sets directoryname used in ctl-buttonDown.)
  1529. <alt-z:    putMsg("Enter directory: ")
  1530.  
  1531.            freeBuf(buf53)
  1532.            if (inputString(buf53)) runKey(virtual-7)
  1533.  
  1534.            freeBuf(buf54)
  1535.            insertRgn(buf54,eFile,"Dir ",all)
  1536.            insertRgn(buf54,eFile,buf38,hilite)
  1537.            if (not execute(buf39,buf54)) returnFalse
  1538.            moveCursor(buf39,sFile)
  1539.            insertChar(buf39,eLine)
  1540.            insertRgn(buf39,sFile,buf38,hilite)
  1541.            newFile
  1542.            swapBuf(buf39,curFile)
  1543.            freeBuf(buf39)
  1544.            vScroll(sFile)
  1545.            putMsg("To load files, ctrl-click names with mouse.")
  1546.            setFileName(curFile,buf54)
  1547.            flipFlag(curFile,changed) >
  1548.  
  1549. Change the current working directory
  1550. <altCtl-z:  putMsg("Change current directory to (may not work in Workbench):")
  1551.             freeBuf(buf53)
  1552.             if (inputString(buf53)) changeDir(buf53) >
  1553.  
  1554. Clear leading white space in cursor line
  1555. <alt-1:   equateLoc(curFile,locA,atCursor)
  1556.           if (not is(curFile,sLine)) moveCursor(curFile,sLine)
  1557.           while (is(curFile,whiteSpace)) {
  1558.                 if (is(curFile,eLine)) goto label(1)
  1559.                 if (is(curFile,12)) goto label(1) .. formfeed
  1560.                 clearChar(curFile)
  1561.           }
  1562.           label(1)
  1563.           equateLoc(curFile,atCursor,locA) >
  1564.  
  1565. Center text in the line.  (Uses current line length.)
  1566. <alt-2:
  1567.            runKey(alt-1) .. clear leading white space
  1568.            if (is(curFile,blankLine)) returnFalse
  1569.            if (not is(curFile,eLine)) moveCursor(curFile,eLine)
  1570.            locToCol(curFile,n53,atCursor)
  1571.            equateNum(n54,lineLength)
  1572.            incNum(n54)
  1573.            if (gtNum(n54,n53)) {
  1574.                moveCursor(curFile,sLine)
  1575.                sub(n53,n54,n53)
  1576.                div(n53,n53,2)
  1577.                do (n54,2,n53) insertChar(curFile," ")
  1578.            } >
  1579.  
  1580. Match indent of cursor line to previous line
  1581. <alt-4:     equateNum(n54,0)
  1582.             moveCursor(curFile,upLine)
  1583.             if (not getFlag(curFile,autoIndent)) {
  1584.                 flipFlag(curFile,autoIndent)
  1585.             equateNum(n54,1)
  1586.             }
  1587.             if (not is(curFile,eLine)) moveCursor(curFile,eLine)
  1588.             clearChar(curFile)
  1589.             typeChar(eLine)
  1590.             if (eqNum(n54,1)) flipFlag(curFile,autoIndent)
  1591.             moveCursor(curFile,downLine) >
  1592.  
  1593. Right-align the cursor line from cursor rightward
  1594. <alt-5:    if (not is(curFile,whiteSpace)) moveCursor(curFile,sChar)
  1595.            if (is(curFile,eLine)) goto label(0)
  1596.            while (is(curFile,whiteSpace)) {
  1597.                    if (is(curFile,sLine)) goto label(0)
  1598.                    clearChar(curFile)
  1599.                    moveCursor(curFile,sChar)
  1600.            }
  1601. label(0)   
  1602.            moveCursor(curFile,eChar)
  1603.            equateLoc(curFile,locA,atCursor)
  1604.               if (not is(curFile,eLine)) moveCursor(curFile,eLine)
  1605.            locToCol(curFile,n54,atCursor)
  1606.            decNum(n54)
  1607.            getLocal(curFile,n53,lineLength)
  1608.            sub(n54,n53,n54)
  1609.            moveCursor(curFile,locA)
  1610.            if (gtNum(n54,0)) while (decNum(n54)) insertChar(curFile," ") >
  1611.  
  1612. Show the value of a number variable
  1613. <alt-8:    putMsg("n-variable #: ")
  1614.            inputNum(n54)
  1615.            freeBuf(buf54)
  1616.            insertChar(buf54,"n")
  1617.            toWord(buf54,n54)
  1618.            insertRgn(buf54,eFile," is ",all)
  1619.            toWord(buf54,n[n54])
  1620.            putMsg(buf54) >
  1621.  
  1622. Set the value of a number variable
  1623. <alt-9:    putMsg("Set n-variable #:")
  1624.            inputNum(n54)
  1625.            putMsg("To value:")
  1626.            inputNum(n[n54])>
  1627.  
  1628. Show the ASCII value of the character under the cursor
  1629. <ctl-/:    copyChar(curFile,n54)
  1630.            freeBuf(buf54)
  1631.            toWord(buf54,n54)
  1632.            insertRgn(buf54,sFile,"Character value under cursor was ",all)
  1633.            putMsg(buf54)
  1634.            moveCursor(curFile,eChar) >
  1635.  
  1636. Show the current document size
  1637. <ctl-1:    fileSize(curFile,n54)
  1638.            freeBuf(buf54)
  1639.            insertRgn(buf54,sFile,"File size in bytes: ",all)
  1640.            toWord(buf54,n54)
  1641.            putMsg(buf54)>
  1642.  
  1643. Switch displaying of cursor row-column off/on
  1644. <ctl-2:    flipFlag(curFile,rowCol) >
  1645.  
  1646. This is a simple reformat cmd that doesn't refmt indented paragraphs.
  1647. .. <ctl-3:    if (reformat) moveCursor(curFile,downLine) >
  1648.  
  1649. Reformat cursor paragraph, starting at cursor line
  1650. <ctl-3:               .. move down, if blank line, to find par beginning.
  1651.         while (is(curFile,blankLine)) {
  1652.             moveCursor(curFile,downLine)
  1653.             if (not is(curFile,eLine)) moveCursor(curFile,eLine)
  1654.             if (is(curFile,eFile)) returnFalse
  1655.         }
  1656.         equateNum(n3,0)                     .. a flag used below
  1657.         equateLoc(curFile,locA,atCursor)    .. store par beginning
  1658.  
  1659. label(2) .. get indent of 1st par line
  1660.         if (not is(curFile,sLine)) moveCursor(curFile,sLine)
  1661.         while (is(curFile,whiteSpace)) moveCursor(curFile,eChar)
  1662.         locToCol(curFile,n0,atCursor)       .. get the 1st line's indent
  1663.  
  1664.         if (eqNum(n3,0)) {          .. if doing FIRST line
  1665.             equateNum(n1,n0)        .. store indent of 1st par line
  1666.             equateNum(n3,1)         .. set a flag so won't come back here
  1667.             equateLoc(curFile,locB,atCursor)    .. store 1st text location
  1668.             moveCursor(curFile,downLine)        .. move to 2nd line
  1669.             if (is(curFile,blankLine)) {        .. no second line
  1670.                 equateNum(n0,1)
  1671.                 goto label(3)
  1672.             }
  1673.             goto label(2)       .. go back and get indent of 2nd par line
  1674.         }
  1675. label(3)
  1676.         moveCursor(curFile,upLine)      .. move back to 1st line
  1677.         equateNum(n2,n0)                .. store indent of 2nd line
  1678.  
  1679.         if (eqNum(n2,-1)) goto label(4) .. was no 2nd line
  1680.         if (geNum(n2,n1)) {             .. 2nd line inset, so do only 1st line
  1681. label(4)
  1682.             reformat
  1683.             goto label(5)               .. finished
  1684.         } else {                        .. 2nd line has less or equal indent
  1685.             sub(n1,n1,n2)               .. par indent = 1st indent minus 2nd
  1686.             colToLoc(curFile,atCursor,n2)
  1687.             equateLoc(curFile,locA,atCursor)
  1688.             clearRgn(curFile,loc)       .. wiping out extra 1st line indent
  1689.             do (n54,1,n1) insertChar(curFile,"x")   .. repl with x's
  1690.             moveCursor(curFile,sWord)               .. made a FAKE WORD
  1691.             equateLoc(curFile,locA,atCursor)        .. store its loc
  1692.             reformat                        .. now paragrah has SAME indent
  1693.             equateLoc(curFile,locB,atCursor)        .. store end of par
  1694.             moveCursor(curFile,locA)                .. go back to fake word
  1695.             while (is(curFile,"x")) {               .. swap x's for spaces
  1696.                 swapChar(curFile," ")
  1697.                 moveCursor(curFile,eChar)
  1698.             }                                       .. now fake word is gone
  1699.             equateLoc(curFile,atCursor,locB)        .. goto end of par
  1700. label(5)
  1701.             moveCursor(curFile,downLine)            .. leave paragraph
  1702.         }
  1703. >
  1704.  
  1705. Delete all trailing white-space in current document
  1706. <ctl-4:    equateLoc(curFile,locA,atCursor)
  1707.            moveCursor(curFile,sFile)
  1708.            label(1)
  1709.            if (is(curFile,eFile))
  1710.                { equateLoc(curFile,atCursor,locA) return }
  1711.            moveCursor(curFile,eLine)
  1712.            moveCursor(curFile,sChar)
  1713.            label(2)
  1714.            if (is(curFile,space))
  1715.                { clearChar(curFile) moveCursor(curFile,sChar) goto label(2)}
  1716.            if (is(curFile,9))       ..  a TAB
  1717.                { clearChar(curFile) moveCursor(curFile,sChar) goto label(2)}
  1718.            moveCursor(curFile,eLine)
  1719.            goto label(1) >
  1720.  
  1721. Save a learn-sequence to disk, saving it under a Name
  1722. <ctl-5:    putMsg("Save learn seq under what Name?")
  1723.            freeBuf(buf54)
  1724.            if (inputString(buf54))
  1725.                    if (not saveLearn(buf54)) putMsg("Couldn't save") >
  1726.  
  1727. Load a learn-sequence stored on disk
  1728. <ctl-6:    putMsg("Load what learn seq Name?")
  1729.            freeBuf(buf54)
  1730.            if (inputString(buf54))
  1731.                    if (not loadLearn(buf54)) putMsg("Not found") >
  1732.  
  1733. Load and run learn-sequence stored on disk
  1734. <ctl-7:    putMsg("Load & run what learn seq Name?")
  1735.            freeBuf(buf54)
  1736.            if (inputString(buf54))
  1737.                    if (loadLearn(buf54)) runLearn else putMsg("Not found") >
  1738.  
  1739. Toggle case-sensitivity of search
  1740. <ctl-8:    flipFlag(curFile,searchCaps) >
  1741.  
  1742.                         *** arithmetic commands ***
  1743.  
  1744. Set running arithmetic total to zero
  1745. <ctl-0:     equateNum(n49,0) >
  1746.  
  1747. Type the running arithmetic total into text at cursor
  1748. <ctl-\:     freeBuf(buf54)
  1749.             div(n52,n49,100)
  1750.             if (gtNum(0,n49)) if (eqNum(n52,0)) insertChar(buf54,"-")
  1751.             toWord(buf54,n52)
  1752.             insertChar(buf54,".")
  1753.             if (gtNum(0,n49)) mul(n52,n49,-1)
  1754.             else equateNum(n52,n49)
  1755.             mod(n52,n52,100)
  1756.             if (gtNum(10,n52)) insertChar(buf54,"0")
  1757.             toWord(buf54,n52)
  1758.             insertRgn(curFile,atCursor,buf54,all)
  1759.             insertRgn(buf54,sFile,"Inserted total into text ",all)
  1760.             putMsg(buf54) >
  1761.  
  1762. Add the next word (if a number) to arithmetic total & display total
  1763. <ctl-=:     moveCursor(curFile,eWord)
  1764.             moveCursor(curFile,sWord)
  1765.             if (not is(curFile,digit)) returnFalse
  1766.             toNumber(n54,curFile)
  1767.             moveCursor(curFile,eWord)
  1768.             if (is(curFile,".")) {
  1769.                moveCursor(curFile,eChar)
  1770.                if (not is(curFile,digit)) goto label(1)
  1771.                toNumber(n53,curFile)
  1772.                moveCursor(curFile,eChar)
  1773.                if (not is(curFile,digit)) {
  1774.                    mul(n53,n53,10)
  1775.                    moveCursor(curFile,sChar)
  1776.                }
  1777.                moveCursor(curFile,eWord)
  1778.             } else { label(1) equateNum(n53,0) }
  1779.             mul(n54,n54,100)
  1780.             if (gtNum(0,n54)) mul(n52,n53,-1)
  1781.             else equateNum(n52,n53)
  1782.             add(n54,n54,n52)
  1783.             add(n49,n49,n54)
  1784.             freeBuf(buf54)
  1785.             div(n52,n49,100)
  1786.             if (gtNum(0,n49)) if (eqNum(n52,0)) insertChar(buf54,"-")
  1787.             toWord(buf54,n52)
  1788.             insertChar(buf54,".")
  1789.             mod(n52,n49,100)
  1790.             if (gtNum(0,n49)) mul(n52,-1,n52)
  1791.             if (gtNum(10,n52)) insertChar(buf54,"0")
  1792.             toWord(buf54,n52)
  1793.             insertRgn(buf54,sFile,"Running total is ",all)
  1794.             putMsg(buf54) >
  1795.  
  1796. Subtract the next word (if a number) from arithmetic total & display total
  1797. <ctl--:     moveCursor(curFile,eWord)
  1798.             moveCursor(curFile,sWord)
  1799.             if (not is(curFile,digit)) returnFalse
  1800.             toNumber(n54,curFile)
  1801.             moveCursor(curFile,eWord)
  1802.             if (is(curFile,".")) {
  1803.                moveCursor(curFile,eChar)
  1804.                if (not is(curFile,digit)) goto label(1)
  1805.                toNumber(n53,curFile)
  1806.                moveCursor(curFile,eChar)
  1807.                if (not is(curFile,digit)) {
  1808.                    mul(n53,n53,10)
  1809.                    moveCursor(curFile,sChar)
  1810.                }
  1811.                moveCursor(curFile,eWord)
  1812.             } else { label(1) equateNum(n53,0) }
  1813.             mul(n54,n54,100)
  1814.             if (gtNum(0,n54)) mul(n52,n53,-1)
  1815.             else equateNum(n52,n53)
  1816.             add(n54,n54,n52)
  1817.             sub(n49,n49,n54)
  1818.             freeBuf(buf54)
  1819.             div(n52,n49,100)
  1820.             if (gtNum(0,n49)) if (eqNum(n52,0)) insertChar(buf54,"-")
  1821.             if (gtNum(0,n49)) insertChar(buf54,"-")
  1822.             toWord(buf54,n52)
  1823.             insertChar(buf54,".")
  1824.             mod(n52,n49,100)
  1825.             if (gtNum(0,n52)) mul(n52,n52,-1)
  1826.             if (gtNum(10,n52)) insertChar(buf54,"0")
  1827.             toWord(buf54,n52)
  1828.             insertRgn(buf54,sFile,"Running total is ",all)
  1829.             putMsg(buf54) >
  1830.  
  1831.                            *** columnar data ***
  1832.  
  1833. Put up msg saying turn ON columnar if it is OFF.
  1834. <virtual-`: if (not getFlag(curFile,columnar)) {
  1835.     alertUser("Turn ON columnar display mode first.  (See Columnar menu.)")
  1836.     abort
  1837.   } >
  1838.     ..flipFlag(curFile,columnar)>
  1839.  
  1840. Toggle between columnar display and regular hilite/invert display mode
  1841. <shftCtl-`: flipFlag(curFile,columnar) refreshDisplay>
  1842.  
  1843. Copy and then clear the hilited columnar data
  1844. <shftCtl-1: runKey(virtual-`)         
  1845.             freeBuf(buf37)            
  1846.             copyColData(buf37,sFile,curFile,hilite,1)
  1847.             clearColData(curFile,hilite,0)  > 
  1848.                                       
  1849. Space-fill the hilited columnar data, overlaying the original text.  No copy
  1850. <shftCtl-2: runKey(virtual-`)         
  1851.             clearColData(curFile,hilite,1) >
  1852.                                       
  1853. Copy the hilited columnar data into a buffer
  1854. <shftCtl-3: runKey(virtual-`)
  1855.             if (geLoc(curFile,sHilite,eHilite)) returnFalse
  1856.             freeBuf(buf37) copyColData(buf37,sFile,curFile,hilite,1)>
  1857.  
  1858. Insert copied columnar data at the cursor
  1859. <shftCtl-4: runKey(virtual-`)
  1860.             copyColData(curFile,atCursor,buf37,all,1)>
  1861.  
  1862. Overlay copied columnar data onto existing text at the cursor
  1863. <shftCtl-5: runKey(virtual-`)
  1864.             copyColData(curFile,atCursor,buf37,all,0)>
  1865.  
  1866. Insert the columnar hilite region at the cursor.  (No intermediate copy.)
  1867. <shftCtl-6: runKey(virtual-`)
  1868.             copyColData(curFile,atCursor,curFile,hilite,1)>
  1869.  
  1870. Overlay the columnar hilite region onto existing text at the cursor
  1871. <shftCtl-7: runKey(virtual-`)
  1872.             copyColData(curFile,atCursor,curFile,hilite,0)>
  1873.  
  1874.                           *** interlace mode ***
  1875.  
  1876. Switch to next display mode
  1877. <shft-esc: flipFlag(curFile,lace) >
  1878.  
  1879. Tune the RGB colors in interlace using mouse.  (See alt-Help also.)
  1880. <alt-esc:  laceColor>
  1881.  
  1882. Assign a name to one of the 4 gadgets (1-4)
  1883. <ctl-esc:  putMsg("Enter gadget number (1-4):")
  1884.            if (not inputNum(n54)) returnFalse
  1885.            if (gtNum(n54,4)) returnFalse
  1886.            if (gtNum(1,n54)) returnFalse
  1887.            putMsg("Enter gadget name (one Space to clear):")
  1888.            freeBuf(buf54)
  1889.            inputString(buf54)
  1890.            if (not isEmpty(buf54)) {
  1891.                gadgetName(n54,buf54)
  1892.                putMsg(" ")
  1893.            } >
  1894.  
  1895. Uedit's "About..." shareware message
  1896. <shftAltCtl-a:
  1897.    equateNum(n54,curFile)
  1898.    freeBuf(buf54)
  1899.    insertRgn(buf54,sFile,
  1900. "
  1901.  
  1902.                   :               Uedit                :
  1903.                   : Copyright (C) 1986-88, Rick Stiles :
  1904.                   :           P.O. Box  666            :
  1905.                   :        Washington, IN 47501        :
  1906.  
  1907.  
  1908. Uedit is SHAREWARE.
  1909.  
  1910. Try it and see how you like it.
  1911.  
  1912. If you wish to purchase the full Uedit package which lets you create a
  1913. permanent custom environment and which has a comprehensive printed manual
  1914. with complete program documentation and editing hints for getting the most
  1915. out of Uedit, see your dealer or see Uedit-Policy for ordering information.
  1916.  
  1917. If your dealer doesn't carry Uedit, please have him contact me.
  1918.  
  1919. ",all)
  1920.    equateLoc(buf54,sPage,sFile)
  1921.    moveCursor(buf54,eFile)
  1922.    do (n52,1,50) insertChar(buf54,eLine)
  1923.    moveCursor(buf54,sFile)
  1924.    do (n52,1,5) moveCursor(buf54,eLine)
  1925.    equateLoc(buf54,eHilite,atCursor)
  1926.    do (n52,1,3) moveCursor(buf54,upLine)
  1927.    do (n52,1,38) moveCursor(buf54,sChar)
  1928.    equateLoc(buf54,sHilite,atCursor)
  1929.    moveCursor(buf54,eFile)
  1930.    if (getFlag(curFile,columnar)) equateNum(n51,0)
  1931.    else { flipFlag(curFile,columnar) equateNum(n51,1) }
  1932.    editBuf(buf54)
  1933.    vScroll(sFile)
  1934.    setFileName(buf54,"         About Uedit...")
  1935.    updateDisplay
  1936.    putMsg("  ")
  1937.    getKey(n53)
  1938.    editBuf(buf[n54])
  1939.    .. updateDisplay
  1940.    putMsg(" ")
  1941.    if (eqNum(n51,1)) flipFlag(curFile,columnar)
  1942.    freeBuf(buf54)
  1943. >
  1944.  
  1945.                                    *****
  1946.  
  1947. Assign new Primitive Mode terminator Ctrl-key
  1948. <normal-esc: putMsg("Enter new Primitive Mode terminator CTRL-key (pmESC)")
  1949.              if (getChar(n54))
  1950.                 if (gtNum(32,n54)) equateNum(pmESC,n54)
  1951.              putMsg(" ") >
  1952.  
  1953. Save changed files during idle periods, if their idle-save flag is set
  1954. <idle:  getMaxFiles(n52)
  1955.         decNum(n52)
  1956.         do (n54,0,n52)
  1957.             if (not inputWaiting)
  1958.                 if (getflag(buf[n54],changed))
  1959.                     if (getflag(buf[n54],userLocalA)) saveFile(buf[n54]) >
  1960.  
  1961.                           *** end of Config!M ***
  1962.  
  1963.